package com.uyayo.system.config.service;

import java.util.List;

import com.uyayo.framework.common.exception.CodeMultipleException;
import com.uyayo.framework.common.exception.ParentNotFoundException;
import com.uyayo.framework.pagehelper.pojo.PageBean;
import com.uyayo.system.config.entity.SysDictionary;
import com.uyayo.system.config.entity.SysDictionaryData;


public interface SysDictionaryService {
	
	List<SysDictionary> selectSysDictionary(SysDictionary dictionary);

	SysDictionary getDictionaryById(Long id);

	/**
	 * 根据code查询字典
	 * @param code
	 * @return
	 */
	SysDictionary getDictionaryByCode(String code);

	/**
	 * 添加字典
	 * @param sysDictionary
	 * @return
	 */
	int insertDictionary(SysDictionary sysDictionary);

	/**
	 * 修改字典
	 * @param sysDictionary
	 * @return
	 */
	int updateDictionary(SysDictionary sysDictionary);
	
	/**
	 * 根据编码获取下级字典
	 * @return
	 */
	List<SysDictionaryData> selectSysDictinaryDataByCode(String code);

	List<SysDictionaryData> selectSysDictionaryData(SysDictionaryData dictionaryDataQUERY);
	
	int deleteDictionary(Long id);
	
	int deleteDictionaryData(Long id);

    PageBean<SysDictionary> selectSysDictionaryByPage(int i, Integer pageSize, String sort, String order, SysDictionary sysDictionary);

	/**
	 * 根据编码获取字典数据
	 * @param code
	 * @return
	 */
	SysDictionaryData getDictionaryDataByCode(String code);

	SysDictionaryData selectDictionaryDataById(Long id);

	/**
	 * 添加字典数据
	 * @param sysDictionaryData
	 * @return
	 */
	int insertDictionaryData(SysDictionaryData sysDictionaryData) throws ParentNotFoundException, CodeMultipleException;

	int selectCountByParentId(Long parentId);

    int updateDictionaryData(SysDictionaryData sysDictionaryData) throws ParentNotFoundException, CodeMultipleException;

}
